<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      body,
      html {
        padding: 0;
        margin: 0;
      }

      @page {
        margin: 0px;
      }

      .div1 {
        overflow: hidden;
      }
    </style>
  </head>

  <body>
    
    <img id="bd" >测试进行中
  </body>

  <script>
    const { ipcRenderer } = require('electron')
    ipcRenderer.on('webview-print-render', (event, info) => {
      // const body = document.getElementById('bd')
      // body.innerHTML = JSON.stringify(info)
      // 执行渲染
      const img = document.getElementById('bd')
      img.width = info.width;
      img.height = info.height;
      img.src = info.html;
      console.log(info);
      ipcRenderer.sendToHost('webview-print-do')
    })
  </script>
</html>
